<div class="custom">

    <h1>
        新增订单
    </h1>

    <div ng-if="data.isShowDetail">

        <div class="panel panel-default" >

            <div class="panel-heading clearfix">
                商品列表 订单号：{{data.orderNo}}
                <div class="btn-group pull-right" role="group" aria-label="...">
                    <button type="button" class="btn btn-warning btn-sm" ng-click="saveOrderDetailInfo();">全部保存</button>
                    <button type="button" class="btn btn-default btn-sm" ng-click="data.isShowDetail=false;">收起</button>
                </div>
            </div>

            <table class="table table-bordered panel-body table-hover table-condensed ">

                <thead>
                <tr>
                    <th width="10%">#</th>
                    <th width="20%">商品id</th>
                    <th width="20%">商品名称</th>
                    <th width="20%" hidden>单位</th>
                    <!--<th width="20%">订单数量</th>-->
                    <th width="10%">实际购买数量</th>
                    <th width="10%">单价</th>
                    <th width="10%">总价</th>
                </tr>
                </thead>

                <tbody>
                <tr ng-repeat="item in orderDetailList">
                    <th>{{$index+1}}</th>
                    <td>{{item.commodityId}}</td>
                    <td>{{item.commodityName}}</td>
                    <th hidden>{{item.unit}}</th>
                    <!--<td><input type="number" ng-model="item.actualNumber"  ng-show="queryData.orderStatus==0"><span  ng-show="queryData.orderStatus!=0">{{item.actualNumber}}</span></td>-->
                    <!--<td><input type="number" ng-model="item.number" ng-show="queryData.orderStatus!=2"><span ng-show="queryData.orderStatus==2"></span></td>-->
                    <td>{{item.number}}</td>
                    <td>{{item.unitPrice}}</td>
                    <td>{{item.totalPrice}}</td>
                </tr>

                </tbody>

            </table>

        </div>


    </div>



    <div class="panel panel-default">

        <div class="panel-heading clearfix">
            新订单列表
            <!--<div class="btn-group btn-group-sm pull-right" role="group" aria-label="...">-->
                <!--<a type="button" class="btn btn-success" ui-sref="admin.addLinePreOrder" >添加订单</a>-->
            <!--</div>-->

            <div style="margin-right:10px;" class="btn-group btn-group-sm pull-right" role="group" aria-label="...">
                <a class="btn btn-warning" ng-click="genernate()">生成采购单</a>
            </div>
        </div>

        <table class="table table-bordered table-condensed" >
            <thead>
            <tr>
                <th width="5%">#</th>
                <th width="10%">订单号</th>
                <th width="20%">客户店名</th>
                <th width="15%">客户需求</th>
                <th width="10%">订单状态</th>
                <th width="10%">支付方式</th>
                <th width="15%">送货日期</th>
                <th width="20%">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in data.resultData">
                <th>{{$index+1}}</th>
                <th>
                    {{item.orderNo}}
                </th>
                <th>
                    {{item.customerName}}
                </th>
                <th>
                    {{item.remarks}}
                </th>
                <th>
                    {{item.orderStatus | payStatus }}
                </th>
                <td>{{item.payType | payType }}</td>
                <th>
                    {{item.receivingDate}}
                </th>
                <td>
                    <a ng-click="queryOrderDetail(item.orderId);" href="">详细</a>
                    <a ui-sref="admin.addLinePreOrder({id:item.orderId})">修改</a>
                    <a ng-click="del(item.orderId)">删除</a>
                    <a ng-click="paySuccess(item.orderId);" class="btn btn-xs btn-success" ng-hide="item.orderStatus == 1">支付完成</a>
                </td>
            </tr>
            </tbody>
        </table>

        <div class="panel-footer" style="text-align: center;">
            <uib-pagination style="margin:0;" ng-change="pageChanged(data.currentPage)" total-items="data.totalSize" ng-model="data.currentPage"
                            items-per-page="data.pageSize" max-size="5" class="pagination-sm" boundary-links="true"
                            rotate="false"></uib-pagination>
        </div>

    </div>

    <div ng-if="!data" style="text-align: center">
        加载中...
    </div>

</div>